package gases.as3.testing
{
	import flash.display.Bitmap;
	import flash.display.DisplayObject;
	import flash.display.Loader;
	import flash.display.LoaderInfo;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	import gases.as3.librarys.compnents.ui.basic.GImageBox;
	import gases.as3.debug.DebugBase;
	
	public class TestingGImageBox extends DebugBase
	{
		private var image1:GImageBox;
		private var image2:GImageBox;
		public function TestingGImageBox()
		{
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			
			image1 = new GImageBox();
			image1.Gwidth = 32;
			image1.Gheight = 32;
			this.addChild(image1);
			
			image2 = new GImageBox();
			image2.y = 300;
			this.addChild(image2);
			
			var loader:Loader = new Loader();
			loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
//			loader.load(new URLRequest("F:/llk/1.png"));
			loader.load(new URLRequest("http://192.168.1.195/wx2/res/map/1/tiles/1.jpg"));
		}
		
		private function onComplete(e:Event):void
		{
			var content:DisplayObject = LoaderInfo(e.target).content x;
			image1.source = Bitmap(content).bitmapData;
			image2.source = Bitmap(content);
		}
	}
}




